Blame view

backend/views/cart/index.php 3.48 KB
6c07dc8e   Mihail   add bills models,...
1
2
3
4
5
  <?php
  
  use yii\helpers\Html;
  use yii\grid\GridView;
  use kartik\date\DatePicker;
e044346b   Mihail   finish with cart ...
6
7
  use \yii\widgets\Pjax;
  use \yii\bootstrap\Modal;
6c07dc8e   Mihail   add bills models,...
8
9
10
11
12
13
14
  
  /* @var $this yii\web\View */
  /* @var $searchModel common\models\CartBillsSearch */
  /* @var $dataProvider yii\data\ActiveDataProvider */
  
  $this->title = Yii::t('app', 'Заказы');
  $this->params['breadcrumbs'][] = $this->title;
8b0defd0   Mihail   add mails classes
15
  
e044346b   Mihail   finish with cart ...
16
17
18
19
20
  $safe_bill_img0 = '/storage/checkbox0.gif';
  $safe_bill_img1 = '/storage/checkbox1.gif';
  
  \backend\assets\CartAsset::register($this);
  Pjax::begin(['id' => 'gridViewContent']);
6c07dc8e   Mihail   add bills models,...
21
  ?>
e044346b   Mihail   finish with cart ...
22
  
6c07dc8e   Mihail   add bills models,...
23
24
25
26
27
28
29
30
31
32
33
  <div class="cart-bills-index">
  
      <h1><?= Html::encode($this->title) ?></h1>
      <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  
  
      <?= GridView::widget([
          'dataProvider' => $dataProvider,
          'filterModel' => $searchModel,
          'columns' => [
              ['class' => 'yii\grid\SerialColumn'],
e044346b   Mihail   finish with cart ...
34
35
36
37
38
39
40
41
              ['content' => function ($model) {
                  $url = \yii\helpers\Url::to(['view', 'id' => $model->id]);
                  return Html::a('<span class="glyphicon glyphicon-eye-open">  </span>', '#', [
                      'class' => 'cartModalViewButton',
                      'value' => $url,
                  ]);
              },
              ],
6c07dc8e   Mihail   add bills models,...
42
43
              'id',
              'account_id',
8b0defd0   Mihail   add mails classes
44
              ['label' =>'Информация',
e044346b   Mihail   finish with cart ...
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
                 'format' => 'raw',
                  'value' =>function( $model ) use ($safe_bill_img0, $safe_bill_img1) {
                      $info  = '<b> Код 1С:</b>' . ' ' . $model->scode . '<br>';
                      $info .= '<b> Имя:</b>' . ' ' .$model->name . '<br>';
                      $info .= '<b> Тел.:</b>' . ' ' .$model->phone . '<br>';
                      $info .= '<b> Email:</b>' . ' ' .$model->email . '<br>';
                      $info .= '<b> Доставка:</b>' . ' ' .$model->delivery . '<br>';
                      $info .= '<b> Комментарий:</b>' . ' ' .$model->message . '<br>';
                      $info .= '<b> Страховка:</b>';
                      if ($model->safe_bill == '1') {
                          $info .= " <img src=$safe_bill_img1>";
                      }
                      else {
                          $info .= " <img src=$safe_bill_img0>";
                      }
8b0defd0   Mihail   add mails classes
60
61
62
                      return $info;
                  },
              ],
6c07dc8e   Mihail   add bills models,...
63
64
65
66
67
68
69
70
71
              'sum',
              [
                  'label' =>'Статус',
                  'attribute' => 'status',
                  'filter' => \yii\helpers\ArrayHelper::map( \common\models\DicStatuses::find()->where(['active' =>1])->all(), 'id','name' ),
              ],
              'manager_name',
              [
                  'label' =>'Дата',
8b0defd0   Mihail   add mails classes
72
73
74
                  'value' =>function ($data) {
                      return date('Y-m-d', $data->dt);
                  },
6c07dc8e   Mihail   add bills models,...
75
76
                  'attribute' => 'dt',
                  'filter' => DatePicker::widget([
8b0defd0   Mihail   add mails classes
77
78
79
80
81
                      'model' =>$searchModel,
                      'language' =>'ru',
                      'size' =>'xs',
                      'separator' =>'по',
                      'attribute' => 'dt',
6c07dc8e   Mihail   add bills models,...
82
                      'type' => DatePicker::TYPE_RANGE,
8b0defd0   Mihail   add mails classes
83
                      'attribute2' => 'date_to',
6c07dc8e   Mihail   add bills models,...
84
85
86
87
88
89
                  ]),
              ],
  
          ],
      ]); ?>
  
e044346b   Mihail   finish with cart ...
90
91
92
93
94
95
96
97
98
99
100
101
      <?php
      // сюда будем всавлять контент модального окна
      Modal::begin([
          //     'header'=>'<h4>Прайс</h4>',
          'id' => 'modal',
          'size' => 'modal-lg',
      ]);
  
      echo "<div class='modalContent'></div>";
      Modal::end();
      Pjax::end();
      ?>
6c07dc8e   Mihail   add bills models,...
102
  </div>