Blame view

backend/views/details-description/view.php 3.18 KB
816a590c   Mihail   add details descr...
1
2
3
4
  <?php
  
  use yii\helpers\Html;
  use yii\widgets\DetailView;
9b0a69f3   Mihail   add details crite...
5
  use yii\bootstrap\ActiveForm;
ec9547bf   Mihail   work on details desc
6
  use yii\grid\GridView;
9b0a69f3   Mihail   add details crite...
7
  use yii\widgets\Pjax;
ec9547bf   Mihail   work on details desc
8
  
816a590c   Mihail   add details descr...
9
10
11
12
  
  /* @var $this yii\web\View */
  /* @var $model common\models\DetailsDescription */
  
edfa67b1   Mihail   add delete price ...
13
  $this->title = 'Карточка товара - ' . $model->name;
816a590c   Mihail   add details descr...
14
15
16
17
18
19
20
  $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Details Descriptions'), 'url' => ['index']];
  $this->params['breadcrumbs'][] = $this->title;
  ?>
  <div class="details-description-view">
  
      <h1><?= Html::encode($this->title) ?></h1>
  
816a590c   Mihail   add details descr...
21
22
23
24
  
      <?= DetailView::widget([
          'model' => $model,
          'attributes' => [
816a590c   Mihail   add details descr...
25
26
              'name',
              'brand',
9b0a69f3   Mihail   add details crite...
27
28
  //            'tecdoc_id',
  //            'tecdoc_article',
816a590c   Mihail   add details descr...
29
              'description',
9b0a69f3   Mihail   add details crite...
30
31
32
33
  //            'tecdoc_description',
  //            'supplier_description',
  //            'article',
  //            'image',
816a590c   Mihail   add details descr...
34
              'tecdoc_image',
9b0a69f3   Mihail   add details crite...
35
   //           'category_id',
816a590c   Mihail   add details descr...
36
37
38
          ],
      ]) ?>
  
6ccb6e69   Mihail   add delete price ...
39
      <?php
9b0a69f3   Mihail   add details crite...
40
41
42
43
      echo Html::tag('hr');
      echo Html::tag('h4','Xарактеристики товара');
      if($count){
          Pjax::begin();
6ccb6e69   Mihail   add delete price ...
44
          echo GridView::widget([
9b0a69f3   Mihail   add details crite...
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
              'dataProvider' => $dataProvider,
              'showHeader' => false,
              'showOnEmpty' => false,
              'columns' => [
                  'key',
                  'value',
                  ['class' => \yii\grid\ActionColumn::className(),
                      'template'=>'{delete}',
                      'buttons' => [
                          'delete' => function ($url, $model, $key) {
                              $url = \yii\helpers\Url::to(['details-description/delete-criteria', 'name' => $model->name, 'brand' => $model->brand, 'key' => $model->key]);
                              return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [
                                  'title' => Yii::t('yii', 'Удалить характеристики'),
                                  'data-confirm' => 'Вы уверены что хотите удалить эти характеристики?',
                                  'data-method' => 'post',
                                  'data-pjax' => '1',
                              ]);
                          },
                      ],
                  ],
              ],
          ]);
          Pjax::end();
      }
  
      ?>
ec9547bf   Mihail   work on details desc
71
72
73
  
      <div class="details-criteria-form">
  
6ccb6e69   Mihail   add delete price ...
74
75
          <?php $form = ActiveForm::begin(['action' =>['details-description/create-criteria'],]); ?>
  
9b0a69f3   Mihail   add details crite...
76
77
78
79
          <?= $form->field( $criteria_model, 'key',  [
              'horizontalCssClasses' => [
                  'input' => 'col-sm-1',
              ]] )->textInput() ?>
ec9547bf   Mihail   work on details desc
80
  
9b0a69f3   Mihail   add details crite...
81
82
83
84
          <?= $form->field( $criteria_model, 'value',  [
              'horizontalCssClasses' => [
                  'input' => 'col-sm-1',
              ]] )->textInput() ?>
ec9547bf   Mihail   work on details desc
85
  
6ccb6e69   Mihail   add delete price ...
86
87
          <?= $form->field( $criteria_model, 'name' )->hiddenInput(['value' => $model->name])->label(false)?>
          <?= $form->field( $criteria_model, 'brand' )->hiddenInput(['value' => $model->brand])->label(false) ?>
ec9547bf   Mihail   work on details desc
88
89
90
  
  
          <div class="form-group">
9b0a69f3   Mihail   add details crite...
91
              <?= Html::submitButton(Yii::t('app', 'Добавить характеристику'), ['class' => 'btn btn-success']) ?>
ec9547bf   Mihail   work on details desc
92
93
94
95
          </div>
  
          <?php ActiveForm::end(); ?>
      </div>
9b0a69f3   Mihail   add details crite...
96
97
     <hr>
  
816a590c   Mihail   add details descr...
98
  </div>