index.php
4.17 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
<?php
use artbox\order\models\Order;
use yii\helpers\Url;
use yii\web\View;
/**
* @var View $this
* @var Order[] $orders
*/
$this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'Мои заказы');
?>
<div id="content">
<div class="container">
<div class="row">
<!-- *** LEFT COLUMN ***
_________________________________________________________ -->
<div class="col-md-9" id="customer-orders">
<p class="text-muted lead">Если у вас есть вопросы, пожалуйста,
<a href="contact.html">напишите нам</a>, наш центр обслуживания клиентов работает круглосуточно.</p>
<div class="box">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Заказ</th>
<th>Дата</th>
<th>Сумма</th>
<th>Статус</th>
<th>Действие</th>
</tr>
</thead>
<tbody>
<?php foreach ($orders as $order) {
$price = 0;
foreach ($order->orderProducts as $product) {
$price += $product->price * $product->count;
}
?>
<tr>
<th>№<?= $order->id; ?></th>
<td><?= date('d.m.Y', $order->created_at); ?></td>
<td><?= $price ?></td>
<?php if (empty($order->label)) { ?>
<td><span class="label label-info">Не задан</span>
</td>
<?php
} else { ?>
<td>
<span style="background-color:<?= $order->label->color ?>" class="label label-info"><?= $order->label->lang->title ?></span>
</td>
<?php }
?>
<td><a href="<?= Url::to(
[
'account/order',
'id' => $order->id,
]
) ?>" class="btn btn-template-main btn-sm">Посмотреть</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- /.table-responsive -->
</div>
<!-- /.box -->
</div>
<!-- /.col-md-9 -->
<!-- *** LEFT COLUMN END *** -->
<!-- *** RIGHT COLUMN ***
_________________________________________________________ -->
<div class="col-md-3">
<!-- *** CUSTOMER MENU ***
_________________________________________________________ -->
<div class="panel panel-default sidebar-menu">
<div class="panel-heading">
<h3 class="panel-title">Раздел пользователя</h3>
</div>
<div class="panel-body">
<ul class="nav nav-pills nav-stacked">
<li class="active">
<a href="customer-orders.html"><i class="fa fa-list"></i> Мои заказы</a>
</li>
<li>
<a href="customer-wishlist.html"><i class="fa fa-heart"></i> Мои пожелания</a>
</li>
<li>
<a href="customer-account.html"><i class="fa fa-user"></i> Мой аккаунт</a>
</li>
<li>
<a href="index.html"><i class="fa fa-sign-out"></i> Выйти</a>
</li>
</ul>
</div>
</div>
<!-- /.col-md-3 -->
<!-- *** CUSTOMER MENU END *** -->
</div>
<!-- *** RIGHT COLUMN END *** -->
</div>
</div>
<!-- /.container -->
</div>
<!-- /#content -->