_add_price.php
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
49
<?php
/**
* @var \common\models\PriceLang $price_lang;
* @var \common\models\Price $price
* @var integer $lastId;
* @var integer $service_id
* @var array $languages
*/
use artbox\core\admin\assets\Switchery;
use yii\web\View;
use yii\widgets\ActiveForm;
$form = new ActiveForm();
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);
?>
<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']);
}
?>
<?= $form->field($price, '['.$lastId.']status')
->checkbox(
[
'class' => 'switchery',
]
) ?>
<a class="delete-variant delete-url remove-img-2 btn-danger btn" href="#"></a>
</div>
</div>