Blame view

frontend/views/accounts/feedback-company.php 4.92 KB
37c8e264   Yarik   test
1
2
3
4
5
6
7
  <?php
      use common\models\FeedbackCompanySearch;
      use yii\data\ActiveDataProvider;
      use yii\grid\ActionColumn;
      use yii\grid\GridView;
      use yii\grid\SerialColumn;
      use yii\helpers\Html;
713ccea4   Yarik   test
8
      use yii\jui\DatePicker;
37c8e264   Yarik   test
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
      use yii\web\View;
  
      /**
       * @var View                  $this
       * @var FeedbackCompanySearch $searchModel
       * @var ActiveDataProvider    $dataProvider
       */
      $this->title = 'Заявки';
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
  <div class="login-left-column-title fix"><?= $this->title ?></div>
  <div class="admin-table-portfolio">
      <?= GridView::widget([
          'options'      => [ 'class' => 'style admin-all-pages-wr fix_last_td_' ],
          'dataProvider' => $dataProvider,
          'filterModel'  => $searchModel,
          'columns'      => [
              [ 'class' => SerialColumn::className() ],
              [
                  'attribute' => 'date_add',
713ccea4   Yarik   test
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
                  'filter'    => "<div class=\"input-group input-group-xs input-daterange\">
  <span class='field-teamsearch-experience_from_from'>" . DatePicker::widget([
                          'model'         => $searchModel,
                          'attribute'     => 'date_add_from',
                          'language'      => 'ru',
                          'dateFormat'    => 'yyyy-MM-dd',
                          'clientOptions' => [
                              'changeYear'  => true,
                              'changeMonth' => true,
                              'maxDate' => ($searchModel->date_add_to?:date('Y-m-d')),
                          ],
                      ]) . "</span>
  <span class=\"input-group-addon kv-field-separator\">
  <i class=\"glyphicon glyphicon-resize-horizontal\"></i>
  </span>
  <span class='field-teamsearch-experience_from_to'>" . DatePicker::widget([
                          'model'         => $searchModel,
                          'attribute'     => 'date_add_to',
                          'language'      => 'ru',
                          'dateFormat'    => 'yyyy-MM-dd',
                          'clientOptions' => [
                              'changeYear'  => true,
                              'changeMonth' => true,
                              'minDate' => $searchModel->date_add_from,
                              'maxDate' => date('Y-m-d'),
                          ],
                      ]) . "</span>
  </div>",
                  'value'     => function($model, $key) {
37c8e264   Yarik   test
58
                      return date('Y-m-d H:i:s', $model->date_add);
713ccea4   Yarik   test
59
                  },
37c8e264   Yarik   test
60
61
62
              ],
              [
                  'attribute' => 'name',
713ccea4   Yarik   test
63
                  'label'     => 'Имя и фамилия',
37c8e264   Yarik   test
64
65
66
67
              ],
              'phone',
              [
                  'attribute' => 'status',
713ccea4   Yarik   test
68
69
70
71
72
73
74
                  'filter' => [
                      1 => 'Только непрочитанные',
                  ],
                  'filterInputOptions' => [
                      'prompt' => 'Все записи',
                      'class' => 'form-control',
                  ],
37c8e264   Yarik   test
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
              ],
              [
                  'class'    => ActionColumn::className(),
                  'buttons'  => [
                      'delete' => function($url, $model, $key) {
                          return Html::a(Html::tag('span', '', [
                              'class' => 'glyphicon glyphicon-trash',
                          ]), [
                              'accounts/feedback-delete',
                              'id' => $model->feedback_company_id,
                          ], [
                              'title'        => 'Удалить',
                              'aria-label'   => 'Удалить',
                              'data-confirm' => 'Вы уверены, что хотите удалить данную заявку?',
                              'data-method'  => 'post',
                              'data-pjax'    => 0,
                          ]);
                      },
713ccea4   Yarik   test
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
                      'read'   => function($url, $model, $key) {
                          if($model->status == $model::STATUS_NEW) {
                              return Html::a(Html::tag('span', '', [
                                  'class' => 'glyphicon glyphicon-ok',
                              ]), [
                                  'accounts/feedback-read',
                                  'id' => $model->feedback_company_id,
                              ], [
                                  'title'        => 'Прочесть',
                                  'aria-label'   => 'Прочесть',
                                  'data-confirm' => 'Вы уверены, что хотите отметить заявку прочтенной?',
                                  'data-method'  => 'post',
                                  'data-pjax'    => 0,
                              ]);
                          } else {
                              return false;
                          }
                      },
37c8e264   Yarik   test
111
                  ],
713ccea4   Yarik   test
112
                  'template' => '{read}{delete}',
37c8e264   Yarik   test
113
114
115
116
              ],
          ],
      ]); ?>
  </div>