Blame view

frontend/views/account/index.php 3.52 KB
950817c6   Alex Savenko   first commit
1
2
3
  <?php
      
      use artbox\order\models\Order;
10e74468   mzavalniuk   translate to ua r...
4
5
  use yii\helpers\Html;
  use yii\helpers\Url;
950817c6   Alex Savenko   first commit
6
7
8
9
10
11
12
      use yii\web\View;
      
      /**
       * @var View    $this
       * @var Order[] $orders
       */
      
10e74468   mzavalniuk   translate to ua r...
13
      $this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'My orders');
950817c6   Alex Savenko   first commit
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  
  ?>
  
  <div id="content">
    <div class="container">
      
      
      <div class="row">
        
        <!-- *** LEFT COLUMN ***
  _________________________________________________________ -->
        
        <div class="col-md-9" id="customer-orders">
          
10e74468   mzavalniuk   translate to ua r...
28
29
30
31
32
33
34
35
36
37
38
39
          <p class="text-muted lead"><?php echo \Yii::t(
                  'app',
                  'registration_text',
                  [
                      'link' => Html::a(
                          \Yii::t('app', 'write to us'),
                          [
                              'site/contact',
                          ]
                      ),
                  ]
              ); ?></p>
950817c6   Alex Savenko   first commit
40
41
42
43
44
45
46
          
          <div class="box">
            
            <div class="table-responsive">
              <table class="table table-hover">
                <thead>
                  <tr>
10e74468   mzavalniuk   translate to ua r...
47
48
49
50
51
                    <th><?=Yii::t('app','Order')?></th>
                    <th><?=Yii::t('app','Date')?></th>
                    <th><?=Yii::t('app','Amount')?></th>
                    <th><?=Yii::t('app','Status')?></th>
                    <th><?=Yii::t('app','Action')?></th>
950817c6   Alex Savenko   first commit
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
                  </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)) { ?>
10e74468   mzavalniuk   translate to ua r...
67
                            <td><span class="label label-info"><?=Yii::t('app','Not specified')?></span>
950817c6   Alex Savenko   first commit
68
69
70
71
72
73
74
75
76
77
78
79
80
                            </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,
                                ]
10e74468   mzavalniuk   translate to ua r...
81
                            ) ?>" class="btn btn-template-main btn-sm"><?=Yii::t('app','View')?></a>
950817c6   Alex Savenko   first commit
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
                        </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 ***
  _________________________________________________________ -->
            <?= $this->render('_menu'); ?>
          <!-- /.col-md-3 -->
          
          <!-- *** CUSTOMER MENU END *** -->
        </div>
        
        <!-- *** RIGHT COLUMN END *** -->
      
      </div>
    
    
    </div>
    <!-- /.container -->
  </div>
  <!-- /#content -->