Blame view

views/order/_log_item.php 1.27 KB
d3406983   Alexey Boroda   -Order history ha...
1
2
3
4
5
6
7
  <?php
      /**
       * @var OrderLog $model
       * @var Order    $order
       */
      use artweb\artbox\ecommerce\models\Order;
      use artweb\artbox\ecommerce\models\OrderLog;
d8203a8c   Alexey Boroda   -Updated at bug fix
8
      use yii\helpers\Html;
d3406983   Alexey Boroda   -Order history ha...
9
10
11
12
13
14
15
      use yii\helpers\Json;
  
  ?>
  
  <!-- timeline item -->
  <li>
    <!-- timeline icon -->
ff71eeed   Alexey Boroda   -Logs ready
16
    <i class="fa fa-user bg-orange"></i>
d3406983   Alexey Boroda   -Order history ha...
17
18
19
    <div class="timeline-item">
      <span class="time"><i class="fa fa-calendar"></i> <?= Yii::$app->formatter->asDatetime($model->created_at) ?></span>
  
d8203a8c   Alexey Boroda   -Updated at bug fix
20
      <h3 class="timeline-header">Пользователь: <span class="text-orange"><?= $model->user->username ?></span></h3>
d3406983   Alexey Boroda   -Order history ha...
21
22
  
      <div class="timeline-body">
ff71eeed   Alexey Boroda   -Logs ready
23
        <table class="table table-bordered table-striped">
d3406983   Alexey Boroda   -Order history ha...
24
25
          <tr>
            <th>Поле</th>
ff71eeed   Alexey Boroda   -Logs ready
26
27
            <th>Старое значение</th>
            <th>Новое значение</th>
d3406983   Alexey Boroda   -Order history ha...
28
29
30
          </tr>
            <?php
                foreach (Json::decode($model->data) as $key => $item) {
d8203a8c   Alexey Boroda   -Updated at bug fix
31
32
33
34
35
36
37
                    echo Html::tag(
                        'tr',
                        Html::tag('td', $order->attributeLabels()[ $key ]) . Html::tag('td', $item[ 'old' ]) . Html::tag(
                            'td',
                            $item[ 'new' ]
                        )
                    );
d3406983   Alexey Boroda   -Order history ha...
38
39
40
41
42
43
44
                }
            ?>
        </table>
      </div>
  
    </div>
  </li>