Blame view

backend/views/order/index.php 2.73 KB
d8c1a2e0   Yarik   Big commit artbox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <?php
  use yii\helpers\Html;
  use yii\grid\GridView;
  use yii\bootstrap\ActiveForm;
  use yii\helpers\ArrayHelper;
  use backend\models\Label;
  use yii\bootstrap\Modal;
  
  
  $this->title = 'Заказы';
  $this->params['breadcrumbs'][] = $this->title;
  ?>
  <h1>Заказы</h1>
      <p>
8af13427   Yarik   For leha commit.
15
          <?= Html::a('Add order', ['create'], ['class' => 'btn btn-success']) ?>
d8c1a2e0   Yarik   Big commit artbox
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
      </p>
  <?php \yii\widgets\Pjax::begin(   [
  
  ]); ?>
  <?= GridView::widget([
      'dataProvider' => $dataProvider,
      'filterModel' => $searchModel,
      'columns' => [
  
  		[
                  'attribute' => 'id',
                  'format' => 'raw',
                  'options' => ['class' => 'btn btn-warning'],
                  'value' => function($model){
                      return Html::button($model->id, ['id'=>$model->id, 'class' => 'btn btn-warning']);
  
                  }
  
              ],
  		[
  		'attribute' => 'date_time',
  		'value'=>'date_time',
  		],
  
  		[
  		'attribute' => 'name',
  		'value'=>'name',
                  'format'=>'raw',
  		],
  		[
  		'attribute' => 'phone',
  		'value'=>'phone',
  		],
2d636887   Alexey Boroda   -Admin order card...
49
50
51
52
53
54
55
56
57
58
59
60
61
  //		[
  //		'attribute' => 'total',
  //		'value'=>'total',
  //		],
  //		[
  //			'filter'    => yii\helpers\ArrayHelper::map(Label::find()->orderBy('id')->asArray()->all(), 'id', 'label'),
  //			'attribute' => 'label',
  //			'value' => function ($model, $key, $index, $column) {
  //					return Html::activeDropDownList($model, 'label',
  //						yii\helpers\ArrayHelper::map(Label::find()->orderBy('id')->asArray()->all(), 'id', 'label'),
  //						[
  //							'prompt' => 'Нет',
  //							'onchange' => "$.ajax({
8af13427   Yarik   For leha commit.
62
  //								 url: \"/admin/order/labelupdate\",
2d636887   Alexey Boroda   -Admin order card...
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  //								 type: \"post\",
  //								 data: { order_id:  $model->id, label_id : this.value},
  //								});"
  //						]
  //
  //					);
  //				},
  //			'format' => 'raw',
  //		],
  //        [
  //            'attribute' => 'pay',
  //			'filter'    => [
  //				0 => 'Нет',1=>'Да'
  //			],
  //			'value' => function ($model, $key, $index, $column) {
  //                return Html::activeDropDownList($model, 'pay',[0 => 'Нет',1=>'Да'],
  //                    [
  //                        'onchange' => "$.ajax({
8af13427   Yarik   For leha commit.
81
  //                                     url: \"/admin/order/payupdate\",
2d636887   Alexey Boroda   -Admin order card...
82
83
84
85
86
87
88
89
90
  //                                     type: \"post\",
  //                                     data: { order_id:  $model->id, pay_id : this.value},
  //                                    });"
  //                    ]
  //
  //                );
  //            },
  //            'format' => 'raw',
  //        ],
d8c1a2e0   Yarik   Big commit artbox
91
92
93
94
95
96
97
98
99
100
101
102
103
  		 [
  		 'attribute' => 'status',
  		 'value'=>'status',
  		 'contentOptions'=>['style'=>'width: 5px;']
  		 ],
          [
              'class'    => 'yii\grid\ActionColumn',
              'template' => '{delete}',
              'contentOptions'=>['style'=>'width: 70px;']
          ],		
      ],
  ]) ?>
  <?php \yii\widgets\Pjax::end(); ?>