Blame view

backend/views/price/_add_price.php 1.28 KB
c2648e65   Anastasia   - prices
1
2
3
4
5
6
7
8
  <?php
      /**
       * @var \common\models\PriceLang $price_lang;
       * @var \common\models\Price $price
       * @var integer $lastId;
       * @var integer $service_id
       * @var array $languages
       */
724308f6   Anastasia   add status to price
9
10
      use artbox\core\admin\assets\Switchery;
      use yii\web\View;
c2648e65   Anastasia   - prices
11
12
13
      use yii\widgets\ActiveForm;
      
      $form = new ActiveForm();
724308f6   Anastasia   add status to price
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
      
      Switchery::register($this);
      $js = <<< JS
  $('.switchery').each(function(idx, elem) {
      if (!$(this).data('switchery')){
          new Switchery(elem, {
      color:'#46b749',
      secondaryColor:'#e2e2e2'
    });
      }
    
  });
  
  JS;
      
      
      $this->registerJs($js, View::POS_READY);
c2648e65   Anastasia   - prices
31
32
33
34
35
36
37
38
39
40
      ?>
  <div class="form-group-33-wr">
  <div class="form-group-33">
      <?php echo $form->field($price, '['.$lastId.']service_id')->hiddenInput()->label(false)?>
      <?php echo $form->field($price, '['.$lastId.']price')?>
      <?php
          foreach ($languages as $key => $value){
              echo $form->field($price_lang, '['.$lastId.']['.$key.']title')->label('Название '.$value['url']);
          }
      ?>
9a97f5a5   Anastasia   - bug fix in price
41
      <?= $form->field($price, '['.$lastId.']status')
724308f6   Anastasia   add status to price
42
43
44
45
46
               ->checkbox(
                   [
                       'class' => 'switchery',
                   ]
               ) ?>
c2648e65   Anastasia   - prices
47
48
49
    <a class="delete-variant delete-url remove-img-2 btn-danger btn" href="#"></a>
  </div>
  </div>